package com.opesoft.app.system.action;

import com.opesoft.app.system.model.Dictionary;
import com.opesoft.pf.jpa.SimpleQL;
import com.opesoft.pf.page.AjaxQueryResult;
import com.opesoft.pf.page.QueryForm;
import com.opesoft.pf.page.ServerQueryResult;

public class DictionaryQueryForm extends Dictionary implements QueryForm
{
	public AjaxQueryResult query()
	{
		SimpleQL ql=new SimpleQL("Dictionary");
		ql.addNumCondition("dictionaryConfigId","=",this.getDictionaryConfigId()+"");
		ql.addStringLikeCondition("name",this.getName());
		ql.addStringLikeCondition("code",this.getCode());
		ql.setOrderBy(new String[]{"rank","id"});

		return new ServerQueryResult(ql.countQL(),ql.queryQL());
	}
}
